/**
 *  fileName:test_promise
 *  time:2020/8/21
 *  todo:$END$
 */

let f = async () => {
  return new Promise((resolve, reject) => {
    if (Math.random() > 0.5) {
      resolve(123)
    } else {
      reject(456)
      console.log(1111)
      resolve(333)
    }
  })
}
let F = async () => {
  try{
    await f()
    console.log(123)
  }catch (e) {
    console.log('e:',e)
  }
}

F()
const obj = {
  a:1,
  b:2
}
for (const objElement in obj) {
  console.log(objElement)
}
